/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.business.service.impl;

import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.business.domain.Zhsq;
import me.zhengjie.business.domain.vo.Kc20Vo;
import me.zhengjie.business.repository.YbryRepository;
import me.zhengjie.business.service.YbryService;
import me.zhengjie.business.service.dto.YbryDto;
import me.zhengjie.config.DebugProperties;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.mnt.domain.Database;
import me.zhengjie.modules.mnt.repository.DatabaseRepository;
import me.zhengjie.modules.mnt.util.SqlUtils;
import me.zhengjie.utils.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.*;

/**
* @website https://el-admin.vip
* @description 服务实现
* @author xiahongbo
* @date 2022-04-15
**/
@Slf4j
@Service
@RequiredArgsConstructor
public class YbryServiceImpl implements YbryService {

    private final DatabaseRepository databaseRepository;
    private final YbryRepository ybryRepository;
    @PersistenceContext
    private EntityManager em;

    @Override
    public Map<String,Object> queryAll(String sfzh) {


        if(!DebugProperties.debug) {
            log.info("生产模式");
            List<Zhsq> isExistHomeTreatmentList = ybryRepository.querySnryHomeTreatment(sfzh);
            if(isExistHomeTreatmentList != null && isExistHomeTreatmentList.size() != 0) {
                Zhsq zhsq = isExistHomeTreatmentList.get(0);
                throw new BadRequestException("身份证号为["+sfzh+"]的老人，已经享受居家照护待遇，待遇期为["+zhsq.getBisZhsqDykkrq()+"~"+zhsq.getBisZhsqDyjsrq()+"]");
            }

            List<Zhsq> isExistHomeApplyingList = ybryRepository.querySnryHomeApplying(sfzh);
            if(isExistHomeApplyingList != null && isExistHomeApplyingList.size() != 0) {
                Zhsq zhsq = isExistHomeApplyingList.get(0);
                throw new BadRequestException("身份证号为["+sfzh+"]的老人，正在申请居家照护。申请时间为"+zhsq.getLrsj()+"");
            }

            List<Zhsq> isExistOrgApplyingList = ybryRepository.querySnryOrgApplying(sfzh);
            if(isExistOrgApplyingList != null && isExistOrgApplyingList.size() != 0) {
                throw new BadRequestException("身份证号为["+sfzh+"]的老人，正在申请机构照护。");
            }


            RefreshData.refresh(sfzh);

            String sql = "select * from ( SELECT" +
                    " info.AAB034_NAME, " +
                    " info.AAC001, " +
                    " info.AAC003, " +
                    " CASE WHEN MOD(SUBSTR(info.AAC002, 17, 1), 2) = 0 THEN '女' ELSE '男' END XB, " +
                    " info.AAC002, " +
                    " info.AAC008, " +
                    " info.AKC021, " +
                    " info.CARDNO, " +
                    " info.AAC031, " +
                    " info.AAB034_CODE, " +
                    " info.AAC008_CODE, " +
                    " info.AKC021_CODE, " +
                    " info.AAC031_CODE, " +
            /*        " kc20.AAB004, " +
                    " kc20.AKC170, " +
                    " kc20.AKB020, " +
                    " kc20.AKB021, " +
                    " kc20.AAE030, " +
                    " kc20.AAE031, " +
                    " kc20.AKC175, " +
                    " kc20.AAE100, " +
                    " kc20.AAE073, " +*/
                    " '' AAB004, " +
                    " '' AKC170, " +
                    " '' AKB020, " +
                    " '' AKB021, " +
                    " '' AAE030, " +
                    " '' AAE031, " +
                    " '' AKC175, " +
                    " '' AAE100, " +
                    " '' AAE073, " +
                    " fee.ACCRYM_BEGN, " +
                    " fee.ACCRYM_END, " +
                    " fee.INSUTYPE, " +
                    " fee.CLCT_CLAG, " +
                    " TO_CHAR(kc08.BEGNDATE, 'YYYY-MM-DD') BEGNDATE, " +
                    " TO_CHAR(kc08.ENDDATE, 'YYYY-MM-DD') ENDDATE, " +
                    " kc08.PAUS_TYPE, " +
                    " kc08.PAUS_TYPE_NAME, " +
                    " kc08.CHG_REA_DSCR " +
                    " FROM view_person info " +
           /*         " left join kc20 on info.AAC001 = kc20.AAC001 " +
                    "  AND kc20.AAE030 < SYSDATE " +
                    "  AND kc20.AAE031 > SYSDATE " +
                    "  AND kc20.AKC175 = '1' " +
                    "  AND kc20.AAE100 = '1' " +*/
                    " LEFT JOIN view_person_fee fee on info.AAC001 = fee.AAC001 " +
                    "  AND fee.ACCRYM_BEGN <= TO_CHAR(SYSDATE, 'YYYYMM') " +
                    "  AND fee.ACCRYM_END >= TO_CHAR(SYSDATE, 'YYYYMM') " +
                    "  and fee.INSUTYPE in ('310','390','411') " +
                    " LEFT JOIN kc08   on info.AAC001 = kc08.AAC001  " +
                    "  AND TO_CHAR(kc08.BEGNDATE, 'YYYYMMDD') <= TO_CHAR(SYSDATE, 'YYYYMMDD')  " +
                    "  AND (TO_CHAR(kc08.ENDDATE, 'YYYYMMDD')  >= TO_CHAR(SYSDATE, 'YYYYMMDD') OR kc08.ENDDATE IS NULL  ) " +
                    "  and fee.INSUTYPE = kc08.INSUTYPE " +
                    " where info.AAC002 = :sfz " +
                    " order by fee.INSUTYPE) " +
                    " where rownum = 1 ";
            Query query = em.createNativeQuery(sql);
            query.setParameter("sfz", sfzh);
            List result = query.getResultList();
            List<YbryDto> list2 = new ArrayList<>();
            for (Object obj : result) {
                Object[] arr = (Object[]) obj;
                YbryDto ybryDto = new YbryDto();
                ybryDto.setAac001(org.springframework.util.StringUtils.isEmpty(arr[1]) ? "" : arr[1].toString());
                ybryDto.setAac003(org.springframework.util.StringUtils.isEmpty(arr[2]) ? "" : arr[2].toString());
                ybryDto.setXb(org.springframework.util.StringUtils.isEmpty(arr[3]) ? "" : arr[3].toString());
                ybryDto.setAac002(org.springframework.util.StringUtils.isEmpty(arr[4]) ? "" : arr[4].toString());
                ybryDto.setAac008(org.springframework.util.StringUtils.isEmpty(arr[5]) ? "" : arr[5].toString());
                ybryDto.setAkc021(org.springframework.util.StringUtils.isEmpty(arr[6]) ? "" : arr[6].toString());
                ybryDto.setCardno(org.springframework.util.StringUtils.isEmpty(arr[7]) ? "" : arr[7].toString());
                ybryDto.setAac031(org.springframework.util.StringUtils.isEmpty(arr[8]) ? "" : arr[8].toString());
                ybryDto.setAab034Code(org.springframework.util.StringUtils.isEmpty(arr[9]) ? "" : arr[9].toString());
                ybryDto.setAab034Name(org.springframework.util.StringUtils.isEmpty(arr[0]) ? "" : arr[0].toString());

                //  服务机构编号
                ybryDto.setAkb020(org.springframework.util.StringUtils.isEmpty(arr[15]) ? "" : arr[15].toString());
                //  定点机构名称
                ybryDto.setAkb021(org.springframework.util.StringUtils.isEmpty(arr[16]) ? "" : arr[16].toString());
                //  开始时间
                ybryDto.setAae030(org.springframework.util.StringUtils.isEmpty(arr[17]) ? "" : arr[17].toString());
                //  终止时间
                ybryDto.setAae031(org.springframework.util.StringUtils.isEmpty(arr[18]) ? "" : arr[18].toString());
                //  审批编号
                ybryDto.setAae073(org.springframework.util.StringUtils.isEmpty(arr[21]) ? "" : arr[21].toString());

                // 缴费标志
                ybryDto.setClctClag(org.springframework.util.StringUtils.isEmpty(arr[25]) ? "" : arr[25].toString());
                // 封锁起始日期
                ybryDto.setBegnDate(org.springframework.util.StringUtils.isEmpty(arr[26]) ? "" : arr[26].toString());
                // 封锁截止日期
                ybryDto.setEndDate(org.springframework.util.StringUtils.isEmpty(arr[27]) ? "" : arr[27].toString());
                // 封锁类别
                ybryDto.setPausType(org.springframework.util.StringUtils.isEmpty(arr[28]) ? "" : arr[28].toString());
                // 封锁类别
                ybryDto.setPausTypeName(org.springframework.util.StringUtils.isEmpty(arr[29]) ? "" : arr[29].toString());
                // 封锁原因
                ybryDto.setChgReaDscr(org.springframework.util.StringUtils.isEmpty(arr[30]) ? "" : arr[30].toString());
                list2.add(ybryDto);
            }

            Map<String, Object> map = new HashMap<String, Object>();
            map.put("content", list2);
            map.put("totalElements", list2.size());
            return map;
        } else {
            log.info("开发模式");
            log.info("测试人员小周身份证: {} ", sfzh);

            List<YbryDto> list2 = new ArrayList<YbryDto>();

            YbryDto ybryDto = new YbryDto();
            ybryDto.setAac003("小周");
            ybryDto.setXb("男");
            ybryDto.setAac001("14497171");
            ybryDto.setAac002("220104200110263322");
            ybryDto.setCardno("D14497171");
            ybryDto.setAac008("城乡居民");
            ybryDto.setAac031("参保");
            ybryDto.setAab034Name("市本级");
            ybryDto.setAab034Code("220101");
            ybryDto.setAkc021("普通人员");
            //  服务机构编号
            ybryDto.setAkb020("");
            //  定点机构名称
            ybryDto.setAkb021("");
            //  开始时间
            ybryDto.setAae030("");
            //  终止时间
            ybryDto.setAae031("");
            //  审批编号
            ybryDto.setAae073("");

            // 缴费标志
            ybryDto.setClctClag("1");
            list2.add(ybryDto);
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("content", list2);
            map.put("totalElements", list2.size());
            return map;
        }

    }

    @Override
    public Map<String, Object> queryHomeCbInfo(String sfzh) {

        if(!DebugProperties.debug) {
            log.info("生产模式");
            String sql = "select * from ( SELECT" +
                    // 人员基本信息
                    /* 参保统筹区 */
                    " info.AAB034_NAME, " +
                    /* 医保个人编码 */
                    " info.AAC001, " +
                    /* 姓名 */
                    " info.AAC003, " +
                    /* 性别 */
                    " CASE WHEN MOD(SUBSTR(info.AAC002, 17, 1), 2) = 0 THEN '女' ELSE '男' END XB, " +
                    /* 证件号码 */
                    " info.AAC002, " +
                    /* 参保类型 */
                    " info.AAC008, " +
                    /* 人员类型 */
                    " info.AKC021, " +
                    /* 社会保障卡号 */
                    " info.CARDNO, " +
                    /* 参保状态 */
                    " info.AAC031, " +
                    /* 参保统筹区代码 */
                    " info.AAB034_CODE, " +
                    /* 参保类型代码 */
                    " info.AAC008_CODE, " +
                    /* 人员类型代码 */
                    " info.AKC021_CODE, " +
                    /* 参保状态代码 */
                    " info.AAC031_CODE, " +
                    // 待遇审批信息
                    /* 单位名称 */
                    " kc20.AAB004, " +
                    /* 审批类别 */
                    " kc20.AKC170, " +
                    /* 服务机构编号 */
                    " kc20.AKB020, " +
                    /* 定点机构名称  */
                    " kc20.AKB021, " +
                    /* 开始时间 */
                    " kc20.AAE030, " +
                    /* 终止时间 */
                    " kc20.AAE031, " +
                    /* 审批标志 */
                    " kc20.AKC175, " +
                    /* 有效标志 */
                    " kc20.AAE100, " +
                    /* 审批编号 */
                    " kc20.AAE073, " +
                    // 缴费表
                    /* 缴费开始期   */
                    " fee.ACCRYM_BEGN, " +
                    /* 缴费终止期   */
                    " fee.ACCRYM_END, " +
                    /* 险种  */
                    " fee.INSUTYPE, " +
                    /* 缴费标志  */
                    " fee.CLCT_CLAG, " +
                    /* 封锁起始日期  */
                    " TO_CHAR(kc08.BEGNDATE, 'YYYY-MM-DD') BEGNDATE, " +
                    /* 封锁截止日期  */
                    " TO_CHAR(kc08.ENDDATE, 'YYYY-MM-DD') ENDDATE, " +
                    /* 封锁类别  */
                    " kc08.PAUS_TYPE, " +
                    /* 封锁类别  */
                    " kc08.PAUS_TYPE_NAME, " +
                    /* 封锁原因  */
                    " kc08.CHG_REA_DSCR " +
                    " FROM view_person info " +
                    " left join kc20 on info.AAC001 = kc20.AAC001 " +
                    "  AND kc20.AAE030 < SYSDATE " +
                    "  AND kc20.AAE031 > SYSDATE " +
                    "  AND kc20.AKC175 = '1' " +
                    "  AND kc20.AAE100 = '1' " +
                    " LEFT JOIN view_person_fee fee on info.AAC001 = fee.AAC001 " +
                    "  AND fee.ACCRYM_BEGN <= TO_CHAR(SYSDATE, 'YYYYMM') " +
                    "  AND fee.ACCRYM_END >= TO_CHAR(SYSDATE, 'YYYYMM') " +
                    "  and fee.INSUTYPE in ('310','390','411') " +
                    " LEFT JOIN kc08   on info.AAC001 = kc08.AAC001  " +
                    "  AND TO_CHAR(kc08.BEGNDATE, 'YYYYMMDD') <= TO_CHAR(SYSDATE, 'YYYYMMDD')  " +
                    "  AND (TO_CHAR(kc08.ENDDATE, 'YYYYMMDD')  >= TO_CHAR(SYSDATE, 'YYYYMMDD') OR kc08.ENDDATE IS NULL  ) " +
                    "  and fee.INSUTYPE = kc08.INSUTYPE " +
                    " where info.AAC002 = :sfz " +
                    " order by fee.INSUTYPE) " +
                    " where rownum = 1 ";
            Query query = em.createNativeQuery(sql);
            query.setParameter("sfz", sfzh);
            List result = query.getResultList();
            List<YbryDto> list2 = new ArrayList<>();
            for (Object obj : result) {
                Object[] arr = (Object[]) obj;
                YbryDto ybryDto = new YbryDto();
                ybryDto.setAac001(org.springframework.util.StringUtils.isEmpty(arr[1]) ? "" : arr[1].toString());
                ybryDto.setAac003(org.springframework.util.StringUtils.isEmpty(arr[2]) ? "" : arr[2].toString());
                ybryDto.setXb(org.springframework.util.StringUtils.isEmpty(arr[3]) ? "" : arr[3].toString());
                ybryDto.setAac002(org.springframework.util.StringUtils.isEmpty(arr[4]) ? "" : arr[4].toString());
                ybryDto.setAac008(org.springframework.util.StringUtils.isEmpty(arr[5]) ? "" : arr[5].toString());
                ybryDto.setAkc021(org.springframework.util.StringUtils.isEmpty(arr[6]) ? "" : arr[6].toString());
                ybryDto.setCardno(org.springframework.util.StringUtils.isEmpty(arr[7]) ? "" : arr[7].toString());
                ybryDto.setAac031(org.springframework.util.StringUtils.isEmpty(arr[8]) ? "" : arr[8].toString());
                ybryDto.setAab034Code(org.springframework.util.StringUtils.isEmpty(arr[9]) ? "" : arr[9].toString());
                ybryDto.setAab034Name(org.springframework.util.StringUtils.isEmpty(arr[0]) ? "" : arr[0].toString());

                //  服务机构编号
                ybryDto.setAkb020(org.springframework.util.StringUtils.isEmpty(arr[15]) ? "" : arr[15].toString());
                //  定点机构名称
                ybryDto.setAkb021(org.springframework.util.StringUtils.isEmpty(arr[16]) ? "" : arr[16].toString());
                //  开始时间
                ybryDto.setAae030(org.springframework.util.StringUtils.isEmpty(arr[17]) ? "" : arr[17].toString());
                //  终止时间
                ybryDto.setAae031(org.springframework.util.StringUtils.isEmpty(arr[18]) ? "" : arr[18].toString());
                //  审批编号
                ybryDto.setAae073(org.springframework.util.StringUtils.isEmpty(arr[21]) ? "" : arr[21].toString());

                // 缴费标志
                ybryDto.setClctClag(org.springframework.util.StringUtils.isEmpty(arr[25]) ? "" : arr[25].toString());
                // 封锁起始日期
                ybryDto.setBegnDate(org.springframework.util.StringUtils.isEmpty(arr[26]) ? "" : arr[26].toString());
                // 封锁截止日期
                ybryDto.setEndDate(org.springframework.util.StringUtils.isEmpty(arr[27]) ? "" : arr[27].toString());
                // 封锁类别
                ybryDto.setPausType(org.springframework.util.StringUtils.isEmpty(arr[28]) ? "" : arr[28].toString());
                // 封锁类别
                ybryDto.setPausTypeName(org.springframework.util.StringUtils.isEmpty(arr[29]) ? "" : arr[29].toString());
                // 封锁原因
                ybryDto.setChgReaDscr(org.springframework.util.StringUtils.isEmpty(arr[30]) ? "" : arr[30].toString());
                list2.add(ybryDto);
            }
            System.out.println("----------open");
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("content", list2);
            map.put("totalElements", list2.size());
            return map;
        } else {
            log.info("开发模式");
            log.info("测试人员小周身份证: {} ", sfzh);

            List<YbryDto> list2 = new ArrayList<YbryDto>();

            YbryDto ybryDto = new YbryDto();
            ybryDto.setAac003("小周");
            ybryDto.setXb("男");
            ybryDto.setAac001("14497171");
            ybryDto.setAac002("220104200110263322");
            ybryDto.setCardno("D14497171");
            ybryDto.setAac008("城乡居民");
            ybryDto.setAac031("参保");
            ybryDto.setAab034Name("市本级");
            ybryDto.setAab034Code("220101");
            ybryDto.setAkc021("普通人员");
            //  服务机构编号
            ybryDto.setAkb020("");
            //  定点机构名称
            ybryDto.setAkb021("");
            //  开始时间
            ybryDto.setAae030("");
            //  终止时间
            ybryDto.setAae031("");
            //  审批编号
            ybryDto.setAae073("");

            // 缴费标志
            ybryDto.setClctClag("1");
            list2.add(ybryDto);
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("content", list2);
            map.put("totalElements", list2.size());
            return map;
        }

    }

    @Override
    public Kc20Vo queryKc20(String rybm) {

        Database database = databaseRepository.findById("746d5e3732114d0cb8ee5985a005cb40").orElseGet(Database::new);

        Kc20Vo kc20 = new Kc20Vo();
        DataSource dataSource = SqlUtils.getDataSource(database.getJdbcUrl(), database.getUserName(), database.getPwd());
        Connection connection = null;
        try {
            connection = dataSource.getConnection();
        } catch (Exception ignored) {}
        try {
            int timeOut = 5;
            if (null == connection || connection.isClosed() || !connection.isValid(timeOut)) {
                //   log.info("connection is closed or invalid, retry get connection!");
                connection = dataSource.getConnection();
            }
            String sql = "SELECT *  " +
                    "  FROM GGJK_CAREINSU_KC20 T  " +
                    "  WHERE  1=1  " +
                    "  AND T.AAC001=?  " +
                    "  AND T.AAE030 < SYSDATE  " +
                    "  AND T.AAE031 > SYSDATE  " +
                    "  AND T.AKC175='1'  " +
                    "  AND T.AAE100='1'";
            PreparedStatement st = connection.prepareStatement(sql);
            st.setString(1, rybm);
            ResultSet rs = st.executeQuery();

            while(rs.next()) {
                //  个人编码
                kc20.setAac001(rs.getString("AAC001"));
                //  姓名
                kc20.setAac003(rs.getString("AAC003"));
                //  服务机构编号
                kc20.setAkb020(rs.getString("AKB020"));
                //  定点机构名称
                kc20.setAkb021(rs.getString("AKB021"));
                //  开始时间
                kc20.setAae030(rs.getString("AAE030"));
                //  终止时间
                kc20.setAae031(rs.getString("AAE031"));
                //  审批编号
                kc20.setAae073(rs.getString("AAE073"));
            }
            System.out.println("----------open");
        } catch (Exception e) {
            //    log.error("create connection error, jdbcUrl: {}", jdbcUrl);
            throw new RuntimeException("create connection error, jdbcUrl: " + e.getMessage());
        } finally {
            CloseUtil.close(connection);
            System.out.println("----------close");
        }

        return kc20;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public JSONObject queryCareinsuInfo(String sfzh) {

        JSONObject jsonObject = new JSONObject();
        if(DebugProperties.rysfz.indexOf(sfzh) == -1 ) {
            // 在测试人员中没indexof到，执行查询

            if(!DebugProperties.debug) {
                RefreshData.refresh(sfzh);
                Object obj = ybryRepository.queryCareinsuInfo(sfzh);
                Object[] arr = (Object[]) obj;
                /* 参保统筹区 */
                String AAB034_NAME = (String)arr[0];
                /* 医保个人编码 */
                String AAC001 = (String)arr[1];
                /* 姓名 */
                String AAC003 = (String)arr[2];
                /* 证件号码 */
                String AAC002 = (String)arr[3];
                /* 参保类型 */
                String AAC008 = (String)arr[4];
                /* 人员类型 */
                String AKC021 = (String)arr[5];
                /* 社会保障卡号 */
                String CARDNO = (String)arr[6];
                /* 参保状态 */
                String AAC031 = (String)arr[7];
                /* 参保统筹区代码 */
                String AAB034_CODE = (String)arr[8];
                /* 参保类型代码 */
                String AAC008_CODE = (String)arr[9];
                /* 人员类型代码 */
                String AKC021_CODE = (String)arr[10];

                jsonObject.put("grbh", AAC001);
                jsonObject.put("ybkh", CARDNO);
                jsonObject.put("cblx", AAC008);
                jsonObject.put("cbtcqCode", AAB034_CODE);
                jsonObject.put("cbtcqName", AAB034_NAME);

            } else {

                // debug开启时，返回小周的测试人员数据
                jsonObject.put("grbh", "14497171");
                jsonObject.put("ybkh", "D14497171");
                jsonObject.put("cblx", "城乡居民");
                jsonObject.put("cbtcqCode", "220101");
                jsonObject.put("cbtcqName", "市本级");
            }
        } else {
            // 测试人员，不执行查询，返回固定信息

            log.info("移动端[YbryServiceImpl - queryCareinsuInfo]测试人员：{}, 测试人员身份证: {} ", DebugProperties.rysfz, sfzh);

            if("220104200110263322".equals(sfzh)) {

                jsonObject.put("grbh", "14497171");
                jsonObject.put("ybkh", "D14497171");
                jsonObject.put("cblx", "城乡居民");
                jsonObject.put("cbtcqCode", "220101");
                jsonObject.put("cbtcqName", "市本级");
            } else if("220102197703310410".equals(sfzh)) {

                jsonObject.put("grbh", "12059378");
                jsonObject.put("ybkh", "D36622690");
                jsonObject.put("cblx", "城镇职工");
                jsonObject.put("cbtcqCode", "220101");
                jsonObject.put("cbtcqName", "市本级");
            } else if("220104198107091810".equals(sfzh)) {

                jsonObject.put("grbh", "12822520");
                jsonObject.put("ybkh", "D36623116");
                jsonObject.put("cblx", "城镇职工");
                jsonObject.put("cbtcqCode", "220101");
                jsonObject.put("cbtcqName", "市本级");
            } else if("220582198002123514".equals(sfzh)) {

                jsonObject.put("grbh", "12557437");
                jsonObject.put("ybkh", "D36622009");
                jsonObject.put("cblx", "城镇职工");
                jsonObject.put("cbtcqCode", "220101");
                jsonObject.put("cbtcqName", "市本级");
            }

            // debug开启时，返回小周的测试人员数据
            return jsonObject;
        }

        return jsonObject;
    }

}